<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
</head>
<script src="<%=request.getContextPath() %>../resources/js/jquery-3.1.1.js" type="text/javascript"></script>
<body>
<h2>修改新闻</h2>
<form action="updateNewsServlet" method="post">
    <input type="hidden" name="newsid" value="${news.newsId}"/>
    修改标题:<input type="text" name="title" value="${news.title}"/><br/>
    所属板块：
            <select name="topicid">
                <option>--请输入板块--</option>
                <c:forEach items="${boardList}" var="b">
                    <option value="${b.topicId}">${b.topicName}</option>
                </c:forEach>
            </select><br/>
    修改内容：<textarea name="context">${news.context}</textarea><br/>
    <input type="submit" value="修改"/>


    <script type="text/javascript">
        $(function () {
            var topid=${news.board.topicId};
            $("select option[value='"+topid+"']").attr("selected","selected");
        })
    </script>

</form>
</body>
</html>
